<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>单品客户-创建合同</title>
    <link rel="icon" href="favicon.ico" type="images/ico">
    <meta name="author" content="dc">
    <link href="/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="/css/materialdesignicons.min.css" rel="stylesheet"/>
    <link href="/css/animate.min.css" rel="stylesheet"/>
    <link href="/css/style.min.css" rel="stylesheet"/>
    <link href="/js/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/js/jquery-confirm/jquery-confirm.min.css"/>
    <!--时间选择插件-->
    <link rel="stylesheet" href="/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css">
    <!--日期选择插件-->
    <link rel="stylesheet" href="/js/bootstrap-datepicker/bootstrap-datepicker3.min.css">
    <link rel="stylesheet" href="/css/input_tags.css"/>
    <link rel="stylesheet" type="text/css" href="/css/daterangepicker.css" />
    <!-- 多选下拉 -->
    <link rel="stylesheet" href="/css/bootstrap-multiselect.css" type="text/css"/>
    <link rel="stylesheet" href="/css/bootstrap-select.css" type="text/css"/>
    <link rel="stylesheet" href="/js/need/verfont.css"/>
    <link rel="stylesheet" href="/js/need/select.2.0.css"/>
    <link rel="stylesheet" href="/css/skin.css"/>
    <link rel="stylesheet" href="/css/contractManager/user/userCreateContract.css"/>
</head>
<body>
<div class="container-fluid">
    <div class="card sub-reset">
        <div class="card-header">
            <h1>创建单品合同</h1>
        </div>
        <div class="card-body body-height">
            <form class="well form-well" id="createSingleContractForm">
                <input type="hidden" name="singleProductCustomerId" id="singleProductCustomerId" th:value="${singleProductCustomerId}">
                <input type="hidden" name="customerId" id="customerId" th:value="${customerId}">
                <input type="hidden" name="customerName" id="customerName" th:value="${customerName}">
                <div class="well form-well">
                    <h2>基本信息</h2>
                    <div class="row from-left">
                        <div class="col-lg-5 col-md-5 col-sm-6 col-xs-12 form-group">
                            <label class="control-label label-required">客户联系人</label>
                            <div class="form-content">
                                <select class="form-control" type="text" id="customerContractList"  title="请选择客户联系人"
                                        data-live-search="true" name="customerContractList"></select>
                            </div>
                        </div>

                        <div class="col-lg-5 col-md-5 col-sm-6 col-xs-12 form-group">
                            <label class="control-label label-required">联系方式</label>
                            <div class="form-content">
                                <input type="text" class="form-control" id="phoneNumber"
                                       placeholder="请先选择客户联系人" name="phoneNumber">
                            </div>
                        </div>

                        <div class="col-lg-5 col-md-5 col-sm-6 col-xs-12 form-group">
                            <label class="control-label label-required">合同起止日期</label>
                            <div class="form-content">
                                <input type="text" class="form-control" id="contractDate" name="contractDate"
                                       placeholder="请选择合同起止日期"  autocomplete="off">
                            </div>
                        </div>

                        <div class="col-lg-5 col-md-5 col-sm-6 col-xs-12 form-group">
                            <label class="control-label">关联跟进记录</label>
                            <div class="form-content">
                                <select class="form-control" id="followRecordList"  title="请选择关联跟进记录" name="followRecordList"></select>
                            </div>
                        </div>
                    </div>
                    <h2>审核信息</h2>
                    <div class="row from-left">
                        <div class="col-lg-10 col-md-10 col-sm-6 col-xs-12 form-group single-payment">
                            <label class="control-label label-required">是否加盖公章</label>
                            <div class="form-content p-t-10">
                                <label class="lyear-radio radio-inline radio-primary m-l-5">
                                    <input type="radio" name="applyElectronicContract" value="1"><span>是</span>
                                </label>
                                <label class="lyear-radio radio-inline radio-primary m-l-10">
                                    <input type="radio" name="applyElectronicContract" value="0" checked><span>否</span>
                                </label>
                            </div>
                        </div>
                    </div>
                </div>


                <div class="well form-well">
                    <input type="text" id="productDiscountTotalInput" hidden>              <!--产品 总金额-->
                    <input type="text" id="productTotalInput" hidden>                      <!--产品 计价总计-->
                    <input type="text" id="examineType" value="0" hidden>                   <!--判定是否需要审核 1为审核-->
                    <h2>订单信息</h2>
                    <div class="active-contract">
                        <h3>产品列表</h3>
                        <div class="total-box"><span class="total">计价总计：<strong id="productTotal">0.00</strong></span>
                        </div>
                        <div id="productTableToolbar" class="toolbar">
                            <button type="button" class="btn btn-success btn-label" data-toggle="modal"
                                    data-target="#addProductModal"><label><i class="mdi mdi-plus"></i></label>添加产品
                            </button>
                        </div>
                        <table id="productTable"></table>
                    </div>

                    <h3>附加费用</h3>
                    <div class="row">
                        <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                            <label class="control-label">金额</label>
                            <div class="form-content">
                                <input type="text" class="form-control" placeholder="该费用不计入业绩和提成" id="surcharge" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')">
                            </div>
                        </div>
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 surcharge-remarks">
                            <label class="control-label label-required">备注</label>
                            <div class="form-content">
                                <textarea class="form-control" rows="3" placeholder="不多于100字"
                                          id="orderSurchargeRemark"></textarea>
                            </div>
                        </div>
                    </div>
                </div>


                <div class="well form-well">
                    <h2>合同金额</h2>
                    <div class="row amount-total">
                        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-6">
                            <div class="well">
                                <h5>合同总金额</h5>
                                <p id="totalAmount">0.00</p>
                            </div>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-6">
                            <div class="well">
                                <h5>合同优惠总金额</h5>
                                <p id="discountAmount">0.00</p>
                            </div>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-6">
                            <div class="well">
                                <h5>合同实际总金额</h5>
                                <p id="realAmount">0.00</p>
                            </div>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-6 col-xs-6">
                            <div class="well">
                                <h5>应收款</h5>
                                <p id="receivables">0.00</p>
                            </div>
                        </div>
                    </div>
                </div>


                <div class="well form-well file-well">
                    <div class="row">
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
                            <div class="file-group form-group">
                                <label class="control-label">合同附件</label>
                                <div class="file-box">
                                    <input type="hidden" id="contractPic" class="image-id">
                                    <input type="file" accept=".doc,.pdf,.docx" id="contractImg" name="contractImg"
                                           class="form-control" onchange="uploadImg('contractImg')">
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12 approval">
                            <div class="file-group">
                                <label class="control-label">合同审核</label>
                                <!--                            <input type="file" accaccept=".png,.jpg,.jpeg,.bmp,.gif,.docx,.doc" class="hidden" id="examineImg">-->
                                <!--                            <input type="hidden" id="examinedPic" class="image-id">-->
                                <!--                            <div class="img-box" id="examineImgBox"></div>-->
                                <!--                            <button class="btn btn-default file-browser" type="button">上传审核图片</button>-->
                                <div class="file-box">
                                    <input type="hidden" id="examinedPic" class="image-id">
                                    <input type="file" accept=".doc,.pdf,.docx" id="examineImgBox" name="examineImgBox" class="form-control"  onchange="uploadImg('examineImgBox')">
                                    <!--                                <input type="file" id="exfileToUpload" name="exfileToUpload" class="form-control"  onchange="fileSelected('exfileToUpload')" />-->

                                </div>
                            </div>
                        </div>
                        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                            <label class="control-label">备注</label>
                            <textarea class="form-control" placeholder="请输入审核意见，不少于10个字" id="contractReviewNotes"></textarea>
                        </div>
                    </div>
                </div>


                <div class="form-actions">
                    <button class="btn btn-primary btn-label form-group" style="margin-bottom: 0" type="button"
                            name="submit"
                            id="submit" onclick="addCustomerContract()"><label><i class="mdi mdi-check"></i></label>提交
                    </button>
                    <button class="btn btn-default" type="reset">重置</button>
                </div>
            </form>
        </div>
    </div>
</div>



<!-- 添加产品 弹窗 -->
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" id="addProductModal">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4>添加产品</h4>
            </div>
            <div class="modal-body">
                <div class="select-switch pull-left" id="productCategories">
                    <label><input type="radio" name="productCategories" value="" checked><span>全部</span></label>
                </div>
                <div class="input-group m-b-10 w-30 pull-right">
                    <input type="text" class="form-control" placeholder="请输入产品名称" id="searchProductName">
                    <span class="input-group-btn"><button type="button" class="btn btn-default" id="productSearch" onclick="contractNoProductList();">搜索</button></span>
                </div>
                <table id="productListTable"></table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="addRow('productListTable', 'productTable');">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>



</body>
<script type="text/javascript" src="/js/jquery-2.2.3.min.js"></script>
<!--<script type="text/javascript" src="/js/jquery.min.js"></script>-->

<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/bootstrapValidator.min.js"></script>
<script type="text/javascript" src="/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="/js/main.min.js"></script>
<script type="text/javascript" src="/js/bootstrap-table/bootstrap-table.min.js"></script>
<script type="text/javascript" src="/js/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript" src="/js/bootstrap-notify.min.js"></script>
<script src="/js/jquery-confirm/jquery-confirm.min.js"></script>
<script type="text/javascript" src="/js/crm/common/lightyear.js"></script>
<!--公共js-->
<script src="/js/crm/common/common.js"></script>
<!--时间选择插件-->
<script src="/js/bootstrap-datetimepicker/moment.min.js"></script>
<script src="/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="/js/bootstrap-datetimepicker/locale/zh-cn.js"></script>
<!--日期选择插件-->
<script src="/js/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
<script src="/js/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<script type="text/javascript" src="/js/crm/common/dataRangePicker.min.js"></script>
<!-- 图片上传插件 -->
<script type="text/javascript" src="/js/upload.img.js"></script>
<!-- 多选框下拉 -->
<script type="text/javascript" src="/js/bootstrap-multiselect.js"></script>
<script type="text/javascript" src="/js/bootstrap-select.js"></script>
<!-- 标签插件 -->
<!--<script type="text/javascript" src="/js/bootstrap-tagsinput/bootstrap3-typeahead.min.js"></script>-->
<script type="text/javascript" src="/js/bootstrap-tagsinput/typeahead.bundle.min.js"></script>
<script type="text/javascript" src="/js/bootstrap-tagsinput/bootstrap-tagsinput.js"></script>
<script src="/js/bootstrapTableSelect.js"></script>
<script src="/js/crm/customerManager/user/userCreateContract.js"></script>

</html>